package interfazGrafica;

import java.awt.Dimension;

import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.JSeparator;
import java.awt.Color;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.SwingConstants;
import javax.swing.JComboBox;
import com.toedter.calendar.JCalendar;
import com.toedter.calendar.JDateChooser;
import javax.swing.JButton;
import java.awt.SystemColor;
import javax.swing.JTextField;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;

public class Turnos extends JPanel{
	private JTextField textFieldHabitacion;
	private JTextField textFieldHoraInicio;
	private JTextField textFieldHoraSalida;
	private JTextField textFieldTiempo;
	private JTextField textFieldImporteTurno;
	private JTextField textFieldTolerancia;
	private JTextField textFieldFecha;
	private JTextField textFieldTotalConsumiciones;
	private JTextField textFieldTotalTurno;
	private JTable tablaConsumiciones;
	private JTable tablaBusqueda;
	
	public Turnos () {
		
		try{UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");}
		catch(Exception e) {}
		
		setPreferredSize(new Dimension(1024, 768));
		setSize(new Dimension(1024, 768));
		setMinimumSize(new Dimension(1024, 768));
		setLayout(null);
		
		JSeparator separator = new JSeparator();
		separator.setForeground(Color.LIGHT_GRAY);
		separator.setBounds(18, 19, 40, 1);
		add(separator);
		
		JLabel lblBuscar = new JLabel("Buscar");
		lblBuscar.setHorizontalAlignment(SwingConstants.CENTER);
		lblBuscar.setFont(new Font("Tahoma", Font.PLAIN, 16));
		lblBuscar.setBounds(46, 10, 81, 21);
		add(lblBuscar);
		
		JSeparator separator_1 = new JSeparator();
		separator_1.setForeground(Color.LIGHT_GRAY);
		separator_1.setBounds(116, 19, 890, 1);
		add(separator_1);
		
		JLabel lblFecha = new JLabel("Fecha:");
		lblFecha.setHorizontalAlignment(SwingConstants.LEFT);
		lblFecha.setFont(new Font("Tahoma", Font.PLAIN, 12));
		lblFecha.setBounds(36, 37, 87, 26);
		add(lblFecha);
		
		JDateChooser dateChooser = new JDateChooser();
		dateChooser.setBounds(79, 37, 100, 26);
		add(dateChooser);
		
		JLabel lblHabitacin = new JLabel("Habitaci\u00F3n:");
		lblHabitacin.setHorizontalAlignment(SwingConstants.LEFT);
		lblHabitacin.setFont(new Font("Tahoma", Font.PLAIN, 12));
		lblHabitacin.setBounds(221, 37, 87, 26);
		add(lblHabitacin);
		
		JComboBox comboBoxHabitacion = new JComboBox();
		comboBoxHabitacion.setBounds(292, 37, 100, 26);
		add(comboBoxHabitacion);
		
		JButton botonBuscar = new JButton("Buscar");
		botonBuscar.setForeground(Color.BLACK);
		botonBuscar.setFont(new Font("Tahoma", Font.PLAIN, 12));
		botonBuscar.setBorder(UIManager.getBorder("Button.border"));
		botonBuscar.setBackground(SystemColor.activeCaptionBorder);
		botonBuscar.setBounds(888, 37, 100, 26);
		add(botonBuscar);
		
		JSeparator separator_2 = new JSeparator();
		separator_2.setForeground(Color.LIGHT_GRAY);
		separator_2.setBounds(18, 81, 988, 1);
		add(separator_2);
		
		JSeparator separator_3 = new JSeparator();
		separator_3.setOrientation(SwingConstants.VERTICAL);
		separator_3.setForeground(Color.LIGHT_GRAY);
		separator_3.setBounds(18, 19, 1, 62);
		add(separator_3);
		
		JSeparator separator_4 = new JSeparator();
		separator_4.setOrientation(SwingConstants.VERTICAL);
		separator_4.setForeground(Color.LIGHT_GRAY);
		separator_4.setBounds(1005, 19, 1, 62);
		add(separator_4);
		
		JSeparator separator_5 = new JSeparator();
		separator_5.setForeground(Color.LIGHT_GRAY);
		separator_5.setBounds(17, 450, 40, 1);
		add(separator_5);
		
		JLabel lblTurno = new JLabel("Turno");
		lblTurno.setHorizontalAlignment(SwingConstants.CENTER);
		lblTurno.setFont(new Font("Tahoma", Font.PLAIN, 16));
		lblTurno.setBounds(27, 440, 108, 21);
		add(lblTurno);
		
		JSeparator separator_6 = new JSeparator();
		separator_6.setForeground(Color.LIGHT_GRAY);
		separator_6.setBounds(109, 450, 896, 1);
		add(separator_6);
		
		JSeparator separator_7 = new JSeparator();
		separator_7.setOrientation(SwingConstants.VERTICAL);
		separator_7.setForeground(Color.LIGHT_GRAY);
		separator_7.setBounds(17, 450, 1, 300);
		add(separator_7);
		
		JSeparator separator_8 = new JSeparator();
		separator_8.setForeground(Color.LIGHT_GRAY);
		separator_8.setBounds(18, 750, 988, 1);
		add(separator_8);
		
		JSeparator separator_9 = new JSeparator();
		separator_9.setOrientation(SwingConstants.VERTICAL);
		separator_9.setForeground(Color.LIGHT_GRAY);
		separator_9.setBounds(1005, 450, 1, 300);
		add(separator_9);
		
		JLabel lblPieza = new JLabel("Habitaci\u00F3n:");
		lblPieza.setVerticalAlignment(SwingConstants.TOP);
		lblPieza.setHorizontalAlignment(SwingConstants.LEFT);
		lblPieza.setFont(new Font("Tahoma", Font.PLAIN, 12));
		lblPieza.setBounds(40, 481, 133, 26);
		add(lblPieza);
		
		JLabel label_2 = new JLabel("Fecha:");
		label_2.setVerticalAlignment(SwingConstants.TOP);
		label_2.setHorizontalAlignment(SwingConstants.LEFT);
		label_2.setFont(new Font("Tahoma", Font.PLAIN, 12));
		label_2.setBounds(40, 513, 133, 26);
		add(label_2);
		
		JLabel label_3 = new JLabel("Hora de Inicio:");
		label_3.setVerticalAlignment(SwingConstants.TOP);
		label_3.setHorizontalAlignment(SwingConstants.LEFT);
		label_3.setFont(new Font("Tahoma", Font.PLAIN, 12));
		label_3.setBounds(40, 545, 133, 26);
		add(label_3);
		
		JLabel lblHoraDeSalida_1 = new JLabel("Hora de Salida:");
		lblHoraDeSalida_1.setVerticalAlignment(SwingConstants.TOP);
		lblHoraDeSalida_1.setHorizontalAlignment(SwingConstants.LEFT);
		lblHoraDeSalida_1.setFont(new Font("Tahoma", Font.PLAIN, 12));
		lblHoraDeSalida_1.setBounds(40, 577, 133, 26);
		add(lblHoraDeSalida_1);
		
		JLabel lblHoraDeSalida = new JLabel("Tiempo Transcurrido:");
		lblHoraDeSalida.setVerticalAlignment(SwingConstants.TOP);
		lblHoraDeSalida.setHorizontalAlignment(SwingConstants.LEFT);
		lblHoraDeSalida.setFont(new Font("Tahoma", Font.PLAIN, 12));
		lblHoraDeSalida.setBounds(40, 609, 133, 26);
		add(lblHoraDeSalida);
		
		JLabel lblImporteTurno = new JLabel("Importe Turno:");
		lblImporteTurno.setVerticalAlignment(SwingConstants.TOP);
		lblImporteTurno.setHorizontalAlignment(SwingConstants.LEFT);
		lblImporteTurno.setFont(new Font("Tahoma", Font.PLAIN, 12));
		lblImporteTurno.setBounds(40, 641, 108, 26);
		add(lblImporteTurno);
		
		JLabel label_7 = new JLabel("Tolerancia:");
		label_7.setVerticalAlignment(SwingConstants.TOP);
		label_7.setHorizontalAlignment(SwingConstants.LEFT);
		label_7.setFont(new Font("Tahoma", Font.PLAIN, 12));
		label_7.setBounds(40, 673, 108, 26);
		add(label_7);
		
		textFieldHabitacion = new JTextField();
		textFieldHabitacion.setText("14");
		textFieldHabitacion.setHorizontalAlignment(SwingConstants.CENTER);
		textFieldHabitacion.setFont(new Font("Tahoma", Font.PLAIN, 12));
		textFieldHabitacion.setEditable(false);
		textFieldHabitacion.setColumns(10);
		textFieldHabitacion.setBounds(161, 476, 107, 26);
		add(textFieldHabitacion);
		
		textFieldHoraInicio = new JTextField();
		textFieldHoraInicio.setText("17:40");
		textFieldHoraInicio.setHorizontalAlignment(SwingConstants.CENTER);
		textFieldHoraInicio.setFont(new Font("Tahoma", Font.PLAIN, 12));
		textFieldHoraInicio.setEditable(false);
		textFieldHoraInicio.setColumns(10);
		textFieldHoraInicio.setBounds(161, 540, 107, 26);
		add(textFieldHoraInicio);
		
		textFieldHoraSalida = new JTextField();
		textFieldHoraSalida.setText("19:20");
		textFieldHoraSalida.setHorizontalAlignment(SwingConstants.CENTER);
		textFieldHoraSalida.setFont(new Font("Tahoma", Font.PLAIN, 12));
		textFieldHoraSalida.setEditable(false);
		textFieldHoraSalida.setColumns(10);
		textFieldHoraSalida.setBounds(161, 572, 107, 26);
		add(textFieldHoraSalida);
		
		textFieldTiempo = new JTextField();
		textFieldTiempo.setText("1:40");
		textFieldTiempo.setHorizontalAlignment(SwingConstants.CENTER);
		textFieldTiempo.setFont(new Font("Tahoma", Font.PLAIN, 12));
		textFieldTiempo.setEditable(false);
		textFieldTiempo.setColumns(10);
		textFieldTiempo.setBounds(161, 604, 107, 26);
		add(textFieldTiempo);
		
		textFieldImporteTurno = new JTextField();
		textFieldImporteTurno.setText("$80.00");
		textFieldImporteTurno.setHorizontalAlignment(SwingConstants.CENTER);
		textFieldImporteTurno.setFont(new Font("Tahoma", Font.PLAIN, 12));
		textFieldImporteTurno.setEditable(false);
		textFieldImporteTurno.setColumns(10);
		textFieldImporteTurno.setBounds(161, 636, 107, 26);
		add(textFieldImporteTurno);
		
		textFieldTolerancia = new JTextField();
		textFieldTolerancia.setText("0:10");
		textFieldTolerancia.setHorizontalAlignment(SwingConstants.CENTER);
		textFieldTolerancia.setFont(new Font("Tahoma", Font.PLAIN, 12));
		textFieldTolerancia.setEditable(false);
		textFieldTolerancia.setColumns(10);
		textFieldTolerancia.setBounds(161, 668, 107, 26);
		add(textFieldTolerancia);
		
		textFieldFecha = new JTextField();
		textFieldFecha.setText("20/08/2014");
		textFieldFecha.setHorizontalAlignment(SwingConstants.CENTER);
		textFieldFecha.setFont(new Font("Tahoma", Font.PLAIN, 12));
		textFieldFecha.setEditable(false);
		textFieldFecha.setColumns(10);
		textFieldFecha.setBounds(161, 508, 107, 26);
		add(textFieldFecha);
		
		JButton botonAgregarObservacion = new JButton("Agregar Observaci\u00F3n");
		botonAgregarObservacion.setForeground(Color.BLACK);
		botonAgregarObservacion.setFont(new Font("Tahoma", Font.PLAIN, 12));
		botonAgregarObservacion.setBorder(UIManager.getBorder("Button.border"));
		botonAgregarObservacion.setBackground(SystemColor.activeCaptionBorder);
		botonAgregarObservacion.setBounds(763, 595, 150, 26);
		add(botonAgregarObservacion);
		
		JScrollPane scrollPane = new JScrollPane();
		scrollPane.setBounds(336, 476, 335, 218);
		add(scrollPane);
		
		tablaConsumiciones = new JTable();
		scrollPane.setViewportView(tablaConsumiciones);
		tablaConsumiciones.setModel(new DefaultTableModel(
			new Object[][] {
				{"2", "Pininas Quilmes", "22.00"},
				{"1", "Marlboro 20", "8.00"},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
				{null, null, null},
			},
			new String[] {
				"Cantidad", "Detalle", "Importe"
			}
		) {
			boolean[] columnEditables = new boolean[] {
				false, false, false
			};
			public boolean isCellEditable(int row, int column) {
				return columnEditables[column];
			}
		});
		tablaConsumiciones.getColumnModel().getColumn(0).setResizable(false);
		tablaConsumiciones.getColumnModel().getColumn(0).setPreferredWidth(30);
		tablaConsumiciones.getColumnModel().getColumn(1).setResizable(false);
		tablaConsumiciones.getColumnModel().getColumn(1).setPreferredWidth(120);
		tablaConsumiciones.getColumnModel().getColumn(2).setResizable(false);
		tablaConsumiciones.getColumnModel().getColumn(2).setPreferredWidth(60);
		
		JLabel label_9 = new JLabel("Total Consumiciones:  $");
		label_9.setHorizontalAlignment(SwingConstants.RIGHT);
		label_9.setFont(new Font("Tahoma", Font.PLAIN, 12));
		label_9.setBounds(337, 705, 235, 26);
		add(label_9);
		
		textFieldTotalConsumiciones = new JTextField();
		textFieldTotalConsumiciones.setText("30.00");
		textFieldTotalConsumiciones.setHorizontalAlignment(SwingConstants.LEFT);
		textFieldTotalConsumiciones.setFont(new Font("Tahoma", Font.PLAIN, 12));
		textFieldTotalConsumiciones.setEditable(false);
		textFieldTotalConsumiciones.setColumns(10);
		textFieldTotalConsumiciones.setBounds(578, 705, 62, 26);
		add(textFieldTotalConsumiciones);
		
		JLabel label_10 = new JLabel("Total Turno:  $");
		label_10.setHorizontalAlignment(SwingConstants.RIGHT);
		label_10.setFont(new Font("Tahoma", Font.BOLD, 14));
		label_10.setBounds(756, 707, 108, 22);
		add(label_10);
		
		textFieldTotalTurno = new JTextField();
		textFieldTotalTurno.setText("110.00");
		textFieldTotalTurno.setHorizontalAlignment(SwingConstants.LEFT);
		textFieldTotalTurno.setFont(new Font("Tahoma", Font.BOLD, 14));
		textFieldTotalTurno.setEditable(false);
		textFieldTotalTurno.setColumns(10);
		textFieldTotalTurno.setBorder(null);
		textFieldTotalTurno.setBounds(865, 708, 69, 21);
		add(textFieldTotalTurno);
		
		JSeparator separator_10 = new JSeparator();
		separator_10.setForeground(Color.GRAY);
		separator_10.setBounds(756, 705, 166, 1);
		add(separator_10);
		
		JSeparator separator_11 = new JSeparator();
		separator_11.setForeground(Color.GRAY);
		separator_11.setBounds(756, 731, 166, 1);
		add(separator_11);
		
		JButton botonModificarTurno = new JButton("Modificar Turno");
		botonModificarTurno.setForeground(Color.BLACK);
		botonModificarTurno.setFont(new Font("Tahoma", Font.PLAIN, 12));
		botonModificarTurno.setBorder(UIManager.getBorder("Button.border"));
		botonModificarTurno.setBackground(SystemColor.activeCaptionBorder);
		botonModificarTurno.setBounds(763, 549, 150, 26);
		add(botonModificarTurno);
		
		JScrollPane scrollPane_1 = new JScrollPane();
		scrollPane_1.setBounds(36, 132, 952, 267);
		add(scrollPane_1);
		
		tablaBusqueda = new JTable();
		scrollPane_1.setViewportView(tablaBusqueda);
		tablaBusqueda.setModel(new DefaultTableModel(
			new Object[][] {
				{null, "", null, null, null, null, null, null},
				{null, null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null, null},
				{null, null, null, null, null, null, null, null},
			},
			new String[] {
				"Fecha", "Habitaci\u00F3n", "Hora de Entrada", "Hora de Salida", "Tiempo", "Turno", "Consumici\u00F3n", "Observaciones"
			}
		));
		tablaBusqueda.getColumnModel().getColumn(0).setPreferredWidth(20);
		tablaBusqueda.getColumnModel().getColumn(1).setPreferredWidth(20);
		tablaBusqueda.getColumnModel().getColumn(2).setPreferredWidth(40);
		tablaBusqueda.getColumnModel().getColumn(3).setPreferredWidth(40);
		tablaBusqueda.getColumnModel().getColumn(4).setPreferredWidth(40);
		tablaBusqueda.getColumnModel().getColumn(5).setPreferredWidth(40);
		tablaBusqueda.getColumnModel().getColumn(6).setPreferredWidth(40);
		tablaBusqueda.getColumnModel().getColumn(7).setPreferredWidth(180);
		
		JSeparator separator_12 = new JSeparator();
		separator_12.setForeground(Color.LIGHT_GRAY);
		separator_12.setBounds(18, 114, 40, 1);
		add(separator_12);
		
		JLabel lblBsqueda = new JLabel("B\u00FAsqueda");
		lblBsqueda.setHorizontalAlignment(SwingConstants.CENTER);
		lblBsqueda.setFont(new Font("Tahoma", Font.PLAIN, 16));
		lblBsqueda.setBounds(56, 105, 81, 21);
		add(lblBsqueda);
		
		JSeparator separator_13 = new JSeparator();
		separator_13.setForeground(Color.LIGHT_GRAY);
		separator_13.setBounds(136, 114, 870, 1);
		add(separator_13);
		
		JSeparator separator_14 = new JSeparator();
		separator_14.setForeground(Color.LIGHT_GRAY);
		separator_14.setBounds(18, 417, 988, 1);
		add(separator_14);
		
		JSeparator separator_15 = new JSeparator();
		separator_15.setOrientation(SwingConstants.VERTICAL);
		separator_15.setForeground(Color.LIGHT_GRAY);
		separator_15.setBounds(18, 114, 1, 303);
		add(separator_15);
		
		JSeparator separator_16 = new JSeparator();
		separator_16.setOrientation(SwingConstants.VERTICAL);
		separator_16.setForeground(Color.LIGHT_GRAY);
		separator_16.setBounds(1005, 114, 1, 303);
		add(separator_16);
		
	}
}
